package com.company.strategy.type2;

/**
 * 具体策略角色，折扣券策略，ZK是折扣的缩写
 */
public class ZKCouponStrategy extends CouponStrategy {

    /**
     * 折扣
     */
    private double rate;

    public ZKCouponStrategy(double rate){
        this.rate = rate;
    }

    @Override
    public double computePrice(Order order) {
        return order.getPrice() * rate;
    }
}
